<?
	include("includes/config.php");
	include("includes/login.php");
	include("includes/functions.php");
	$msh ="";
	$id_utilizator = $_SESSION['id_utilizator'];
	if(@$_POST['pctLucrust']){
		$_SESSION['pctLucru'] = $_POST['pctLucru'];
		$msh = "Punct de lucru setat !";
	}else{
		$rpct = mysql_query("select * from setari_punct_lucru where id_unitate = '$id_utilizator'");
		$row = mysql_fetch_array($rpct);
		$_SESSION['pctLucru'] = $row['id_punct_lucru'];
	}
	
?>
<html>
	<head>
		<link rel="stylesheet" type="text/css" href="css/style.css" />
	</head>
	<body>
		<div id="header"><h1> <? echo detaliFirma('nume_firma'); ?></h1></div>
		<div id="warper">
			<?
				$resMeniu = mysql_query("select * from meniu");
			?>
			<div id="menu">
				<ul>
					<? while($rowMen = mysql_fetch_array($resMeniu)): ?>
					<li><a href="<?echo $rowMen['link'];?>"><? echo $rowMen['numeLink']; ?></a></li>
					<? endwhile; ?>
				</ul>
			</div>
			<div id="content">
				<div id="contentWrap">
					<?
							$rpct = mysql_query("select * from setari_punct_lucru where id_unitate = '$id_utilizator'");
							echo $msh;
					?>
					<form action="" method="post" style="background:#83e04c;">
					<p>
						<label style="color:#000;font-size:16px;font-weight:bold;padding-left:10px;">Seteaza punct de lucru </label>
						<select name="pctLucru">
							<? while($row = mysql_fetch_array($rpct)): ?>
							<option value="<? echo $row['id_punct_lucru'];?>"><? echo $row['nume_punct_lucru'];?></option>
							<? endwhile; ?>
						</select>
						<input type="submit" class="buton" value="Seteaza Punct Lucru" name="pctLucrust">
					</p>
					</form>
				</div>
			</div>
		</div>
	</body>
</html>